package cm.cool.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cm.cool.web.bean.CoinDto;
import cm.cool.web.service.coin.CoinService;
import cm.cool.web.util.respon.PaginationDto;
import cm.cool.web.util.respon.R;

@Controller
@RequestMapping("/Coin")
public class CoinContrller {
		
	@Autowired
	private CoinService coinService;


	
	/**
	 * 按条件查找
	 * @param bill
	 * @param paginationDto
	 * @return
	 */
	@ResponseBody
	@RequestMapping("/findUserNamecoin")
	public R findUserNamecoinDtoCount(CoinDto coin,PaginationDto paginationDto){
		return coinService.findUserNamecoinDtoCount(coin, paginationDto);
	}
	
	/**
	 * 删除记录
	 * @param id
	 * @return
	 */
   @ResponseBody
   @RequestMapping("/deleteByPrimaryKey")
   public R deleteByPrimaryKey(String id){
		return coinService.deleteByPrimaryKey(id);
   }
   
	/**
	 * 添加记录
	 * @param bill
	 * @return
	 */
   @ResponseBody
	@RequestMapping("/insert")
	public R insert(CoinDto coin){
		return coinService.insert(coin);
	}
	 
	/**
	 * 修改记录
	 * @param id
	 * @return
	 */
   @ResponseBody
   @RequestMapping("/updateByPrimaryKeySelective")
   public R updateByPrimaryKeySelective(CoinDto record){
	   return coinService.updateByPrimaryKeySelective(record);
   }
	
   	
	
	
/*   *//**
    * 查询总记录
    * 
    *//*
   @ResponseBody
   @RequestMapping("/findcoinCount")
   public R findcoinCount(CoinDto coin,PaginationDto paginationdto ){
	   
   }*/
   
   
}	
